<!-- user_info.html -->
{% import "macros.html" as macros %}
{% import "user_profile/macros.html" as user_profile_macros %}
<div class="user-info-table">
    <div class="col1">
        <div class='avatar'>
            {{ macros.gravatar(view_user, 128) }}
            {% if request.user == view_user %}
                <p><a 
                    {% if support_custom_avatars %}
                        href="{% url avatar_change %}"
                    {% else %}
                        href="{% url faq %}#gravatar"
                    {% endif %}
                style="font-weight: bold; text-decoration: none; color: #3c6eb4;">{% trans %}change picture{% endtrans %}</a></p>
                {% if support_custom_avatars %}
                <p><a 
                    href="{% url avatar_delete %}"
                    >{% trans %}remove{% endtrans %}</a>
                </p>
                {% endif %}
            {% endif %}
        </div>
        {% if can_show_karma %}
            <div class="scoreNumber">{{view_user.reputation|intcomma}}</div>
            <p><b style="color: #494949; font-weight: bold">{% trans %}karma{% endtrans %}</b></p>
        {% endif %}
        {% if user_follow_feature_on %}
            {{ macros.follow_user_toggle(visitor = request.user, subject = view_user) }}
        {% endif %}
    </div>
    <div class="col2">
        <table class="user-details">
            <tbody style="line-height: 1.5em">
                <tr>
                    <th colspan="2" align="left" style="padding-bottom: 0.5em">
                    <h3>{{ view_user.get_status_display() }}</h3>
                    </th>
                </tr>
                {% if view_user.real_name %}
                <tr>
                    <td>{% trans %}real name{% endtrans %}</td>
                    <td><b>{{view_user.real_name|escape}}</b></td>
                </tr>
                {% endif %}
                {% if request.user|can_see_private_user_data(view_user) %}
                <tr>
                    <td>{% trans %}email{% endtrans %}</td>
                    <td>{{view_user.email}}</td>
                </tr>
                {% endif %}
                {% if settings.GROUPS_ENABLED %}
                <tr>
                    <td>{% trans %}groups{% endtrans %}</td>
                    <td>
                        <div id="user-groups">
                            <table id="groups-list">
                                {% for group in user_groups %}
                                <tr>
                                    {{ macros.user_group(group, groups_membership_info[group.id]) }}
                                </tr>
                                {% endfor %}
                            </table>
                            <div class="clearfix"></div>
                            <a id="add-group">{% trans %}add group{% endtrans %}</a>
                        </div>
                    </td>
                </tr>
                {% endif %}
                <tr>
                    <td>{% trans %}member since{% endtrans %}</td>
                    <td><strong>{{ macros.timeago(view_user.date_joined) }}</strong></td>
                </tr>
                {% if view_user.last_seen %}
                <tr>
                    <td>{% trans %}last seen{% endtrans %}</td>
                    <td><strong title="{{ view_user.last_seen }}">{{ macros.timeago(view_user.last_seen) }}</strong></td>
                </tr>
                {% endif %}
                {% if view_user.website and (not view_user.is_blocked()) %}
                <tr>
                    <td>{% trans %}website{% endtrans %}</td>
                    <td>{{ macros.user_website_link(view_user, max_display_length = 30) }}</td>
                </tr>
                {% endif  %}
                {% if request.user == view_user and 
                    settings.TWITTER_SECRET and 
                    settings.TWITTER_KEY and 
                    settings.ENABLE_SHARING_TWITTER 
                %}
                    {% include "user_profile/twitter_sharing_controls.html" %}
                {% endif %}
                {% if view_user.location or view_user.country %}
                <tr>
                    <td>{% trans %}location{% endtrans %}</td>
                    <td>{{ macros.user_full_location(view_user) }}</td>
                </tr>
                {% endif %}
                {% if view_user.date_of_birth %}
                <tr>
                <!--todo  - redo this with whole sentence translation -->
                    <td>{% trans %}age{% endtrans %}</td>
                    <td>{% trans age=view_user.date_of_birth|get_age%}{{ age }} years old{% endtrans %}</td>
                </tr>
                {% endif %}
                {% if votes_today_left %}
                <tr>
                    <td style="vertical-align: middle;">{% trans %}todays unused votes{% endtrans %}</td>
                    <td style="font-size: 2em; padding-top: 0.5em; padding-bottom: 0.5em;">{{ votes_today_left }}</td>
                </tr>
                {% endif %}
                <tr>
                    <td colspan="2">
                        <div class="user-stats-table" style="margin-top: 0.5em">
                            <div class="up-votes"><i class="fa fa-thumbs-up"></i> {{ up_votes }}</div>
                            <div class="down-votes"><i class="fa fa-thumbs-down"></i> {{ down_votes }}</div>
                        </div>
                    </td>
                </tr>
                {% if request.user == view_user %}
                <tr>
                    <td class="user-profile-tool-links" align="left" colspan="2">
                        <a href="{% url edit_user view_user.id %}" style="text-decoration: none">
                            {% trans %}update profile{% endtrans %}
                        </a>
                        {% if settings.USE_ASKBOT_LOGIN_SYSTEM and request.user == view_user and settings.ALLOW_ADD_REMOVE_LOGIN_METHODS %}
                            | <a href="{{ settings.LOGIN_URL }}?next={{ settings.LOGIN_URL }}" style="text-decoration: none">
                                {% trans %}manage login methods{% endtrans %}
                            </a>
                        {% endif %}
                    </td>
                </tr>  
                {% endif %}
            </tbody>
        </table>
    </div>
</div>
<!-- end user_info.html -->
